{include file="common@public/_category" /}

  <!-- container -->
  <div class="container container-gary">
      <!-- page banner -->
      <div class="product-detail wrap1">
          <div class="product-intro">
              <div class="intro-head clearfix">
                  <div class="intro-position"><a href="javascript:;">全部分类</a> >  <a href="{:url('goods/product/index',array('id'=>$class_info['parentid']))}">{$class_info['parent_type']}</a> >  <a href="{:url('goods/product/index',array('id'=>$class_info['typeid']))}">{$class_info['type']}</a> >  <span>{$class_info.classname}</span></div>
                  <div class="intro-notice">
                      <i class="intro-icon"></i>
                      <div class="picScroll-top">
                          <div class="bd">
                              <ul class="picList clearfix">
                                  <li><a href="">若商品库存缺货，请联系电话或QQ：<span class="red"> 4000785858 </span>咨询咨询咨询</a></li>
                                  <li><a href="">若商品库存缺货，请联系电话或QQ：<span class="red">4000785858 </span>咨询</a></li>
                                  <li><a href="">若商品库存缺货，请联系电话或QQ：<span class="red">4000785858 </span>咨询</a></li>
                              </ul>
                          </div>
                          <div class="hd">
                              <a class="next"></a><ul></ul><a class="prev"></a><span class="pageState"></span>
                          </div>
                      </div>
                  </div>
              </div>

              <div class="product-content clearfix">
                  {include file="product/_detail_left"}
                  <div class="intro-right">
                      <div class="intro-title clearfix">
                          <h3>{$class_info.classname}</h3>
                          <div class="intro-two"><a href=""><i class="two-icon"></i>联系卖家</a> <span class="collection pro-star" style="cursor:pointer;"><i class="two-icon two-icon1"></i>收藏商品</span></div>
                      </div>
                      <ul class="intro-info clearfix">
                          <li><span>商品货号：</span>{$class_info.artno}</li>
                          <li><span>品&nbsp;&nbsp;&nbsp;&nbsp;牌：</span><i class="brandname"></i></li>
                          <li><span>材&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;质：</span>{$class_info.texture}</li>
                          <li ><span style="text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 1;-webkit-box-orient: vertical;">工&nbsp;&nbsp;&nbsp;&nbsp;艺：{$class_info.craft}</span></li>
                          <li><span>标&nbsp;箱&nbsp;量：</span><i class="unitname"></i></li>
                          <li><span>供&nbsp;&nbsp;应&nbsp;&nbsp;商：</span><a class="red shopname" href=""></a></li>
                      </ul>
                      <div class="intro-color">
                          <div class="color-title clearfix">
                              <span class="color-gary"></span> 
                              <span class="color-red"></span>
                              温馨提示：颜色会受显示器不同而有所变化，请以实际物品颜色为准
                          </div>
                          <div class="selector-color color-more">  
                              <ul class="clearfix">
                              {foreach name='goods_list' item='vo'}
                                  <li data-images="[{'path': '{$vo.front}','title':'正面'},{'path': '{$vo.side}','title':'侧面'},{'path': '{$vo.opposite}','title':'背面'}]" data-brand='{$vo.brandname}' data-conversion="{$vo.conversion}" data-shopname="{$vo.shopname}"  data-shopid="{$vo.shopid}" data-colorid="{$vo.colorid}" data-type="{$vo.type}">
                                  {notempty name="vo.colorvalue2"}
                                  <a><spa class="coler-grid" style="background-color:#{$vo.colorvalue1};"><span class="color-cell" style="background-color:#{$vo.colorvalue2};"></span></spa>{$vo.colorname} {$vo.colorcustomcode}</a>
                                  {else/}
                                  <a><span class="coler-grid" style="background-color:#{$vo.colorvalue1};"></span>{$vo.colorname} {$vo.colorcustomcode}</a>
                                  {/notempty}
                                  </li>
                              {/foreach}
                              </ul>
                          </div>
                      </div>
                       <div class="color-title clearfix" {empty name="$Think.session.uid"}style="display:none"{/empty} >
                              <div class="price-add">配送至：</div>
                              <div class="price-city">
                                  <ul id="list1">
                                      <li id="summary-stock">
                                          <div class="dd">
                                              <div id="store-selector">
                                                  <div class="text"><div></div><b></b></div>
                                                  <div onclick="$('#store-selector').removeClass('hover')" class="close"></div>
                                              </div>
                                              <div id="store-prompt"><strong></strong></div>
                                          </div>
                                      </li>
                                  </ul>
                              </div>
                              <ul class="price-ul">
                                  <li class="storehouse current">
                                     发货仓库：<span class="warehouse_checked" data-id="{$warehouse_list.0.warehouseid}">{$warehouse_list.0.warehousename}</span><i></i>
                                     <div class="price-other">
                                        {foreach name='warehouse_list' item='vo'}
                                         <div data-id="{$vo.warehouseid}" >{$vo.warehousename}</div>
                                        {/foreach}
                                     </div>
                                  </li>
                                  <li>会员价格</li>
                              </ul>
                          </div>

<div id='price'>

</div>
                     

                  </div>
              </div>

              <!-- see -->
              <div class="product-more">
                  <div class="product-m-title"><b>买家还在看</b></div>
                  <div class="picScroll-left">
                      <div class="bd">
                          <ul class="picList">
                            {foreach name="about_class" item='vo'}
                              <li>
                                  <div class="pic"><a href="{:url('product/goods_detail',['id' => $vo['classid'], 'type' => $vo['type']])}" ><img src="{$vo.thumb}" /></a></div>
                                  <div class="title"><a href="{:url('product/goods_detail',['id' => $vo['classid'], 'type' => $vo['type']])}"><div>{$vo.classname}</div>款号：{$vo.artno}</a></div>
                                  {foreach name='vo.tag' item='co'}
                                    {if condition="$co.show eq 1"}
                                    <div class="goods-sign">{$co.tagname}</div>
                                    {/if}
                                  {/foreach}
                              </li>
                            {/foreach}
                          </ul>
                      </div>
                      <div class="hd">
                          <a class="next"></a>
                          <ul></ul>
                          <a class="prev"></a>
                          <span class="pageState"></span>
                      </div>
                  </div>
              </div>


              <div class="product-parameter">
                  <div class="parameter-tit"><span>商品描述</span></div>
                  <div class="parameter-con">
                      <ul class="clearfix">
                      {foreach name='attrval_list' item='vo'}
                          <li>{$vo.attrname}：{$vo.detail}</li>
                      {/foreach}
        
                      </ul>
                  </div>
              </div>

              <div class="product-data theHidden">
                  <div class="hmpdLeft">
                      {$class_info.info}
                  </div>
              </div>
          </div>
          
      </div>

  </div>
<script type="text/javascript" src="/public/static/home/js/menu.js"></script>
 <!-- notice -->
<script type="text/javascript" src="/public/static/home/js/jquery.SuperSlide.2.1.1.js"></script>
 <!-- scroll img -->
<script src="/public/static/home/js/163css.js" type="text/javascript"></script>
<!-- location -->
<script src="/public/static/home/js/location.js"></script>
<!-- product img scroll -->
<script type="text/javascript" src="/public/static/home/js/jquery.SuperSlide.2.1.1.js"></script>
<script src="/public/static/home/js/script.js"></script>
<script>

    //会员价格查询
    function priceSearch(){
      var thisObj = $('.clearfix .current');
      var colorid = thisObj.data('colorid');
      var type    = thisObj.data('type');
      var classid = "{$class_info.classid}";
      var warehouseid = $('.warehouse_checked').attr('data-id');
      $.ajax({
             type: "post",
             url: "{:url('product/price')}",
             data: {colorid:colorid,type:type,classid:classid,warehouseid:warehouseid},
             dataType: "json",
             success: function(data){
              $('#price').html(data);
             }
          })
    }

    // top code
    var turn = function(target,time,opts){
    target.find('.top-code').hover(function () {
        $(this).find('.top-c-img').stop().animate(opts[0], time, function () {
      $(this).hide().next().show();
      $(this).next().animate(opts[1],time);
    });
  },function(){
      $(this).find('.top-c-text').animate(opts[0], time, function () {
      $(this).hide().prev().show();
      $(this).prev().animate(opts[1],time);
    });
      });
    }
    var verticalOpts = [{'width':0},{'width':'80px'}];
    turn($('.top-right'), 150, verticalOpts);
    //top select
    $(".top-select").mouseover(function () {
        $(".top-s-text").show();
    })
    $(".top-select").mouseout(function () {
        $(".top-s-text").hide();
    })
    $(".top-s-text div").click(function () {
        var selecttext = $(this).text();
        $(".top-s-head span").text(selecttext);
        $(this).parent(".top-s-text").hide()
    })
    //menu all
    $(".menu-all div").mouseenter(function () {
            $(this).addClass("current");
            $(".submenu").show();
        })
       $(".menu-all div").mouseleave(function () {
            $(this).removeClass("current");
            $(".submenu").hide();
        })
        $(".submenu").mouseenter(function(){
           $(this).show();
           $(".menu-all div").addClass("current")
        })
        $(".submenu").mouseleave(function(){
           $(this).hide();
           $(".menu-all div").removeClass("current")
        })

   //left submenu
    $(".submenu ul li").each(function () {
        var $this = $(this);
        var $children = $this.find('.submenu-pro');
        var $otherChildren = $this.siblings('li').find('.submenu-pro');
        var $childrenList = $children.children('.submenu-total');
        $this.on({
            'mouseenter': function () {
                $children.css({ 'display': 'block', 'width': 221 * parseInt($childrenList.size()) });
                $otherChildren.css('display', 'none');
            },
            'mouseleave': function () {
                $children.css('display', 'none');
            }
        })

    });
    //intro notice
    jQuery(".picScroll-top").slide({
        titCell: ".hd ul",
        mainCell: ".bd ul",
        autoPage: true,
        effect: "top",
        autoPlay: false,
        vis: 1,
        trigger: "click"
    });
    //intro info
    $(".intro-info li:odd").addClass("width")
    //select color
    var options ={
       xzoom: 200,
        yzoom: 200,
        offset: 10,
        position: "right",
        preload: 1,
        lens: 1
            };
    $(".jqzoom").jqueryzoom({options});
    addLoadEvent(Focus());
    $(".selector-color.color-more li").click(function () {   //点击颜色图片事件
    var $imgelist=$(this).data("images");
    var $object=  eval('('+$imgelist+')');
    var $html='';
    var $html1='';
    $.each($object,function(i){
    if(i==0){
    $html+=' <li class="active"><img src="'+$object[i].path+'" /><div class="product-txt">'+$object[i].title+'</div></li>';
    }
    else{
      $html+=' <li><img src="'+$object[i].path+'" /><div class="product-txt">'+$object[i].title+'</div></li>';
    }
    $html1+=' <li><div class="jqzoom"><img src="'+$object[i].path+'" jqimg="'+$object[i].path+'" /></div></li>';
    });
    $("#tFocus-btn ul").html($html);
    $("#tFocus-pic").html($html1);
        $(this).addClass("current").siblings().removeClass("current");
        var colortext = $(this).find("a").text();
        $(".color-red").text(colortext);
        $(".jqzoom").jqueryzoom({
            xzoom: 200,
            yzoom: 200,
            offset: 10,
            position: "right",
            preload: 1,
            lens: 1
        });
        addLoadEvent(Focus());
        $('.brandname').text($(this).data('brand'));
        $('.shopname').text($(this).data('shopname'));
        $('.unitname').text($(this).data('conversion'));
        priceSearch();
        has_collection();
    })
    //intro price
    $(".price-ul li").click(function () {
        $(this).addClass("current").siblings().removeClass("current");
        $(".price-con").hide().eq($(".price-ul li").index(this)).show()
    })
    $(".price-ul li:eq(1)").click(function(){
      if($(this).hasClass("current")){ $(".price-other").hide() }
     })
    $(".price-con table tr:odd").addClass("gary");
    //product img scroll
    jQuery(".picScroll-left").slide({
          titCell:".hd ul",
          mainCell:".bd ul",
          autoPage:true,
          effect:"leftLoop",
          autoPlay:true,
          scroll:5,
          vis:5,
          interTime:6000,
          delayTime:700,
          trigger:"click"
    });
    //storehouse
    $(".storehouse").click(function () {
        $(".price-other").fadeToggle(50);
    })
    $(".price-other div").click(function () {
        var housetext = $(this).text();
        $(".storehouse span").text(housetext);
        var id = $(this).data('id');
        $('.warehouse_checked').attr('data-id',id);
        priceSearch();
    })

    $(".selector-color.color-more li").first().trigger('click');
    $('.collection').click(function(){
      var user_id = "{$Think.session.uid}";

      if(user_id == ''){
        alert('请先登陆');
        return false;
      }

      $('.collection').addClass('selected');
      var classid = "{$class_info.classid}";
      var colorid = $('.clearfix .current').data('colorid');
      var shopid  = $('.clearfix .current').data('shopid');
      var type    = "{:input('type')}";
      $.ajax({
             type: "post",
             url: "{:url('product/collection')}",
             data: {colorid:colorid,classid:classid,shopid:shopid,type:type},
             dataType: "json",
             success: function(data){
              alert(data.msg);
             }
          })
    })


    //判断是否已收藏
    function has_collection(){
      var user_id = "{$Think.session.uid}";
      if(user_id == ''){
        return false;
      }
      var thisObj = $('.clearfix .current');
      var colorid = thisObj.data('colorid');
      var type    = thisObj.data('type');
      var classid = "{$class_info.classid}";

      $.ajax({
        url:"{:url('product/has_collection')}",
        data:{colorid:colorid,type:type,classid,classid},
        async:false,
        type:'post',
        dataType:'json',
        success:function(data){
          if(data.code == 1){
            $('.collection').addClass('selected');
          }else{
            $('.collection').removeClass('selected');
          }
          
        }
      })
    }
    
    
 </script>
</body>
</html>